package com.kma.summer2012.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.kma.summer2012.shared.model.UICrumbsUser;


import java.util.List;

@RemoteServiceRelativePath("CrumbsUserService")
public interface CrumbsUserService extends RemoteService {
    UICrumbsUser getById(int id);

    List<UICrumbsUser> getAllUsers();

    /**
     * Utility/Convenience class.
     * Use UserService.App.getInstance() to access static instance of UserServiceAsync
     */
    public static class App {
        private static final CrumbsUserServiceAsync ourInstance = (CrumbsUserServiceAsync) GWT.create(CrumbsUserService.class);

        public static CrumbsUserServiceAsync getInstance() {
            return ourInstance;
        }
    }
}
